package com.caltco.cargo.ops.modules.sys.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class TaskGanttVO extends BaseEntity implements Serializable {
    @Schema(description = "任务Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Schema(description = "用户id")
    @TableField("user_id")
    @JsonProperty("userId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @Schema(description = "项目id")
    @TableField("project_id")
    @JsonProperty("projectId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long projectId;

    @Schema(description = "项目名称")
    @TableField("project_name")
    @JsonProperty("projectName")
    private String projectName;

    @Schema(description = "任务名称")
    @TableField("task_name")
    @JsonProperty("taskName")
    private String taskName;

    @Schema(description = "任务结束时间")
    @TableField("task_end_time")
    @JsonProperty("taskEndTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime taskEndTime;


    @Schema(description = "任务开始时间")
    @TableField("task_start_time")
    @JsonProperty("taskStartTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime taskStartTime;


    @Schema(description = "任务进度")
    @TableField("process")
    @JsonProperty("process")
    private Double process;

    @Schema(description = "任务描述")
    @TableField("task_description")
    @JsonProperty("taskDescription")
    private String taskDescription;

    @Schema(description = "用户名")
    @TableField("user_names")
    @JsonProperty("userNames")
    private List<String> userNames;

    @Schema(description = "用户名数组")
    @TableField("user_names_string")
    @JsonProperty("userNamesString")
    private String userNamesString;

    @Schema(description = "是否立即发布")
    @TableField("is_publish")
    @JsonProperty("isPublish")
    private Integer isPublish;

    @Schema(description = "项目负责人id")
    @TableField("handler_id")
    @JsonProperty("handlerId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long handlerId;

    @Schema(description = "项目负责人名")
    @TableField("handler_name")
    @JsonProperty("handlerName")
    private String handlerName;

}
